package org.ehe.business.bom.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.ehe.business.bom.domain.BomMaster;
import org.ehe.business.bom.domain.bo.BomPageBo;
import org.ehe.business.bom.domain.dto.BomCreationRequest;

import java.util.List;

/**
 * @author :zhangnn
 * @className :BomMasterService
 * @description: TODO
 * @date 2025-07-30 13:52:56
 */
public interface BomMasterService extends IService<BomMaster> {

    BomMaster createBomMaster(BomCreationRequest bomMaster);

    /**
     * 提交审批
     * @param bomId
     * @param
     */
    BomMaster submitForApproval(Long bomId,Long days,Long workflowInstanceId);

    /**
     * 基于现有BOM创建新BOM（用于BOM转换：EBOM->PBOM->MBOM）
     * @param sourceBomId
     * @param targetBomType
     * @param newBomCode
     * @param newBomName
     * @return
     */
    BomMaster createBomFromExisting(Long sourceBomId, Integer targetBomType, String newBomCode, String newBomName);

    /**
     * 根据项目ID查询BOM列表
     * @param projectId
     * @return
     */
    List<BomMaster> findByProjectId(Long projectId);

    /**
     * 废弃BOM
     * @param id
     * @param obsoleteReason
     */
    void obsoleteBom(Long id, String obsoleteReason);

    /**
     * 审批通过
     * @param bomId
     * @param userId
     * @param code
     */
    BomMaster approveBom(Long bomId, Long userId, String code);

    /**
     * 审批拒绝
     * @param bomId
     * @param rejectReason
     */
    BomMaster rejectBom(Long bomId, String rejectReason);

    BomMaster updateBomMaster(BomCreationRequest request);

    BomMaster submitBomDays(BomCreationRequest request);

    /**
     * 完成BOM
     * @param request
     * @return
     */
    BomMaster completeBom(BomCreationRequest request);
}
